const mongoose = require('mongoose');
const { Article } = require('../../model/article')

module.exports = async (req, res) => {
    var id = req.params.id
    try {
        var data = await Article.findOne({ _id: id })
    } catch (err) {
        return res.send({
            data: null,
            meta: {
                status: 400,
                msg: '请求失败'
            }
        })
    }
    if (data == null) return res.send({
        data: null,
        meta: {
            status: 400,
            msg: '请求失败'
        }
    })
    res.send({
        data: data,
        meta: {
            status: 200,
            msg: '请求成功'
        }
    })

}